package com.sp.common.exception;

import com.sp.common.vo.Result;
import lombok.Getter;
import lombok.Setter;

/**
 * 服务器异常
 */
public class ServiceException extends RuntimeException{
    @Getter
    @Setter
    private String code = Result.error().getCode();

    public ServiceException() {
        super();
    }

    public ServiceException(String code, String message) {
        super(message);
        this.code = code;
    }

    public ServiceException(String message) {
        super(message);
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public ServiceException(Throwable cause) {
        super(cause);
    }

    protected ServiceException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
}
